package com.example.test;

import java.io.BufferedInputStream;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

/**
 * Created by SOAL on 2017/2/21 0021.
 */
public class TDemo {
    public static void main(String[] args) {
        String sss="11";
        List<Object> ls = new ArrayList<Object>();
        ls.add(sss);

        BufferedInputStream s;
        String _ddd;
        String $dd;
//        String 1ddl;
        int c;
        int a=1,b=3;
        switch(a){
            case 1: c=1;
            //case 2,4 :c=2;//error
        }

        final String s2="bbb";
//        s2 +="bc";


//        final的定义了：对于基本类型，final使数值恒定不变；而对于对象引用，final使引用恒定不变。一旦引用被初始化指向一个对象，就无法再把它改为指向另一个对象。然而，对象其自身却是可以被修改的，Java并未提供使任何对象恒定不变的途径。

        final StringBuffer sb = new StringBuffer("a");
        sb.append("b");

//        sb = new StringBuffer("C");

        System.out.println(sb);

        final int ss=10;
//        ss+=3;
//        System.out.println(ss);



        final StringBuffer sb2 = new StringBuffer("ac");
        sb2.append("b");
        System.out.println(sb2);

        List lst = new LinkedList();
        lst.add(1);
        lst.add(3);
        lst.add(4);

        lst.get(1);
        lst.remove(1);

        System.out.println(lst);

        System.out.println("-----------");
        class User{

        }

        User u1 = new User();
        User u2=u1;

        String ss1="a";
        String ss2="a";
        String ss3=ss1;
        System.out.println(u1==u2);
        System.out.println(u1.equals(u2));


        System.out.println(ss1==ss2);
        System.out.println(ss1.equals(ss2));

        System.out.println(ss1==ss3);
        System.out.println(ss1.equals(ss3));


        List<? extends Number> list= new ArrayList<Integer>();
        List<? super Integer> list2= new ArrayList<Number>();

        int oo1 =0;

        Integer oo2 =null;

        System.out.println(oo1);
        System.out.println(oo2);
        char[] aa={'1','2','4'};
        System.out.println(String.valueOf("111"));
        System.out.println(String.valueOf(aa,0,2));
    }
}
